<?php
namespace Home\Controller;
use Think\Controller;

class BaseController extends Controller {
	public function _initialize() {
		$Auth = new \Think\Auth();
		//需要验证的规则列表,支持逗号分隔的权限规则或索引数组
		$name = MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME;
		$uid = $_SESSION['uid'];
		if (!$Auth -> check($name, $uid)) {
			//					redirect('/home/index/error','', 5,'页面跳转中...');
			$this -> assign('errorMessage', '');
			$this -> assign('errorTitle', '无权访问');
			$this -> assign('errorCode', '403');
			$this -> assign('errorSecond', '5');
			$this -> error();
		}

	}

}
?>